<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
<script type="text/javascript" src="../lib/html5.js"></script>
<script type="text/javascript" src="../lib/respond.min.js"></script>
<script type="text/javascript" src="../lib/PIE_IE678.js"></script>
<![endif]-->
    <link href="../css/H-ui.min.css" rel="stylesheet" type="text/css" />
    <link href="../css/H-ui.admin.css" rel="stylesheet" type="text/css" />
    <link href="../lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
    <link href="../lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
    <!--[if IE 6]>
<script type="text/javascript" src="../lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
    <title>工序管理</title>
</head>
<body>
    <div class="pd-20">
        <form id="itemEdit" name="itemEdit" method="post" action="../ashx/spui.ashx" class="form form-horizontal">
            <input type="hidden" class="actionValue" id="editAction" name="action" value="add" />
            <input type="hidden" id="id" name="id" />
            <input type="hidden" id="tablename" name="tablename" value="" />
            <input type="hidden" id="tablemidname" name="tablemidname" value="" />
            <input type="hidden" id="ftype" name="ftype" value="20170505" />
            <input type="hidden" id="ftypename" name="ftypename" value="工序" />
            <input type="hidden" id="ywcheckonly" name="ywcheckonly" value="ftype,fnv1#当前序号已存在!" /><!--唯一性检查-->
            <input type="hidden" id="ffv4" name="ffv4" value="" />
            <div class="row cl">
                <label class="form-label col-1"><span class="c-red">*</span>工序名称：</label>
                <div class="formControls col-2">
                    <input type="text" class="input-text" name="ffv1" id="ffv1" nullmsg="姓名不能为空" datatype="*2-10" placeholder="2~10个字符" />
                </div>
                <div class="col-2"></div>
                <label class="form-label col-1">工序序号：</label>
                <div class="formControls col-2">
                    <input type="text" class="input-text" name="fnv1" id="fnv1" nullmsg="序号不能为空" datatype="n1-2" placeholder="1~2位数字" />
                </div>
                <div class="col-2"></div>
            </div>
            <div class="row cl">
                <label class="form-label col-1">说明：</label>
                <div class="formControls col-7">
                    <input type="text" class="input-text" name="ffv2" id="ffv2" />
                </div>
            </div>
              <div class="row cl">
                <label class="form-label col-1">指定角色：</label>
                <div class="formControls col-7">
                    <select id="ffv3" name="ffv3">
                    </select>
                </div>
                   <div class="col-2"></div>
            </div>

            <div class="row cl">
                <div class="col-6 col-offset-4">
                    <button class="btn btn-primary radius" type="submit" id="btsub1">提交</button>&nbsp;&nbsp;
				<button class="btn btn-secondary radius" type="button" id="btn_reset">重置</button>&nbsp;&nbsp;
				<button onclick="layer_close();" class="btn btn-default radius" type="button">返回</button>
                </div>
            </div>
        </form>
    </div>
    <script src="../hcjsui/Scripts/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="../lib/icheck/jquery.icheck.min.js"></script>
    <script type="text/javascript" src="../lib/Validform/5.3.2/Validform.js"></script>
    <script type="text/javascript" src="../lib/layer/1.9.3/layer.js"></script>
    <script src="../hcjsui/js/_Define.js" type="text/javascript"></script>
    <script type="text/javascript" src="../js/hcui.js"></script>
    <script type="text/javascript" src="../js/hcui_au.js"></script>
    <script type="text/javascript" src="../lib/My97DatePicker/WdatePicker.js"></script>
    <!--以下为多选择下拉ggggggggggggg-->
    <link rel="stylesheet" href="../homepage/css/bootstrap.min.css" type="text/css" />
    <script type="text/javascript" src="../homepage/js/bootstrap.min.js"></script>

    <script type="text/javascript" src="../homepage/js/bootstrap-multiselect.js"></script>
    <link rel="stylesheet" href="../homepage/css/bootstrap-multiselect.css" type="text/css" />
    <script type="text/javascript">
        //加载处理
        function loadin() {
            //本页面 
            spsetBase("Table_SP", "id", "Table_SP as T", "*", "#tablelist", "bs_process", "工序管理", "bs_process");

            hcdosel("RoleID as id,RoleName as name", "sysrolesdic", "", "", "", "roleid", function (data) {
                var products = JSON.parse(data);
             
                var newProducts = new Array();
                var obj = new Object();
                $.each(products, function (index, product) {
                    obj = {
                        label: product.name,
                        value: product.id
                    };
                    newProducts.push(obj);
                });
                $("#ffv3").attr("multiple", "multiple");
                $('#ffv3').multiselect({
                    nonSelectedText: '请至少选择一个',
                    nSelectedText: '个角色',
                    buttonWidth: '100%'
                });
                $("#ffv3").multiselect('dataprovider', newProducts);
                settitleselinfo();
            });


        }

        var Mseltitle="";//中转保存回调的内容
        //设置下拉选择，重复调用原因，不知谁快
        function settitleselinfo() {
            var ca = Mseltitle.split(',');
            for (var i = 0; i < ca.length; i++) {
                var c = ca[i];
                $('#ffv3').multiselect('select', [c]);
            }
        }
        Mhcloadback[0] = "ffv3";//设置要回调的内容
        //重写
        function loadback(data) {
            Mseltitle = data["fv3"];
            settitleselinfo();
        }
        //重写  提交前数据处理
        function hcrBeforeSub() {
            var selected = "";
            $('#ffv3 option:selected').each(function (index, data) {
                selected += data.text + " ";
                //console.log(data);
                //console.log(data.text);
                //alert($(this).val());
                //selected.push([$(this).val()]);
            });
            $("#ffv4").val(selected);
            //$("#ffv4").val($('#ffv3 option:selected').text());
        }


    </script>
</body>
</html>
